<%@page import="fr.iut2.tc4.aideprojet2.torque.generated.GroupePeer"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%-- Directives de page import --%>
<%@ page import="java.util.*"%>
<%@ page import="fr.iut2.tc4.aideprojet2.torque.generated.Etudiant"%>
<%@ page import="fr.iut2.tc4.aideprojet2.torque.generated.EtudiantPeer"%>
<%@ page import="fr.iut2.tc4.aideprojet2.torque.generated.Groupe"%>
<%@ page import="fr.iut2.tc4.aideprojet2.torque.generated.Notes"%>
<%@ page import="fr.iut2.tc4.aideprojet2.torque.generated.GroupePeer"%>
<%@ page import="org.apache.torque.util.Criteria"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="style/style.css" rel="stylesheet" type="text/css">
<title>Test Torque</title>
</head>
<body>

<div class='corps'>
<%@ include file="menu.jsp"%>

<%!
	private String nom;
	private String prenom;
	private Groupe groupe;
	private int nbAbs;
	private List<Notes> notes;
	private String temp; 
	private String intitule;
	private float noteval;
%>

<%
	if (request.getParameter("id") != "") {		
		Etudiant etu = EtudiantPeer.retrieveByPK(Integer.parseInt(request.getParameter("id")));
		nom = etu.getNom();
		prenom = etu.getPrenom();
		groupe = etu.getGroupe();
		nbAbs = etu.getNbabsences();
		notes = etu.getNotess();
	}
%>
	<div class="detail">
	<h1>Etudiant <%=prenom%> <%=nom%></h1>

	<HR width=75% size=4>
	<h2>Informations</h2>
	<p>Groupe: <strong><%=groupe.getNom()%></strong></p>
	<p>Nombre d'absences: <strong><%=nbAbs%></strong></p>
	
	<h2>Notes</h2>
	<table>
	<%
		for (Notes note : notes) {
				intitule = note.getMatieres().getIntitule();
				noteval = (float)note.getNote();
	%>
		<tr>
			<td><strong><%=intitule%></strong></td><td><%=noteval%></td>
		</tr>
	<%
		}
	%>
	</table>

</div>
	
</div>	
</body>
</html>
